package com.ev.asl.vo;

import com.ev.framework.utils.DateUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 成型生产统计表
 *
 * @author 姚家乐
 * @since 2021/5/18 12:52
 */
@Data
public class FormingProductionStatisticsVo implements Serializable {

    /**
     * 生产时间概况
     */
    private List<TimeProfile> timeProfiles;
    /**
     * 作业时间合计
     */
    private BigDecimal workingHoursTtl;
    /**
     * 排料时间合计
     */
    private BigDecimal dischargingTimeTtl;
    /**
     * 清扫时间合计
     */
    private BigDecimal cleaningTimeTtl;
    /**
     * 维修时间合计
     */
    private BigDecimal maintenanceTimeTtl;
    /**
     * 开会时间合计
     */
    private BigDecimal meetingTimeTtl;
    /**
     * 培训时间合计
     */
    private BigDecimal trainingTimeTtl;
    /**
     * 设备保养时间合计
     */
    private BigDecimal upkeepTimeTtl;
    /**
     * 其他时间合计
     */
    private BigDecimal OtherTimeTtl;
    /**
     * 纵合计时间
     */
    private BigDecimal ttlTimeTtl;
    /**
     * 出勤人数合计
     */
    private BigDecimal attendanceTotal;



    /**
     * 生产实绩概况
     */
    private ActualSituation actualSituation;



    /**
     * 不良形态现况
     */
    private List<BadForm> badForms;
    /**
     * 不良形态现况(数量合计)
     */
    private BigDecimal badFormQtyTotal;





    /**
     * 成型能率现况
     */
    private MoldingDuty moldingDuty;

    /**
     * 记录总数
     */
    private Integer total;


    public void create(FormingProductionStatisticsVo vo){

        List<TimeProfile> timeProfiles = new ArrayList<>();
        TimeProfile file1 = new TimeProfile();
        file1.setDateString(DateUtils.format(new Date()));
        file1.setWorkingHours(new BigDecimal("1"));
        file1.setDischargingTime(new BigDecimal("1"));
        file1.setCleaningTime(new BigDecimal("1"));
        file1.setMaintenanceTime(new BigDecimal("1"));
        file1.setMeetingTime(new BigDecimal("1"));
        file1.setTrainingTime(new BigDecimal("1"));
        timeProfiles.add(file1);

        TimeProfile file2 = new TimeProfile();
        file2.setDateString(DateUtils.format(new Date()));
        file2.setWorkingHours(new BigDecimal("2"));
        file2.setDischargingTime(new BigDecimal("2"));
        file2.setCleaningTime(new BigDecimal("2"));
        file2.setMaintenanceTime(new BigDecimal("2"));
        file2.setMeetingTime(new BigDecimal("2"));
        file2.setTrainingTime(new BigDecimal("2"));
        timeProfiles.add(file2);



        ActualSituation actualSituation = new ActualSituation();
        actualSituation.setTotalMoldedQty(new BigDecimal("1"));
        actualSituation.setQualifiedQty(new BigDecimal("1"));
        actualSituation.setInspectionQty(new BigDecimal("1"));
        actualSituation.setYield(new BigDecimal("1"));

        List<BadForm> badForms = new ArrayList<>();
        BadForm badForm1 = new BadForm();
        badForm1.setBadItemKeyId(1);
        badForm1.setBadItemKey("碳化");
        badForm1.setBadItemValue(new BigDecimal("2"));
        badForms.add(badForm1);

        BadForm badForm2 = new BadForm();
        badForm2.setBadItemKeyId(1);
        badForm2.setBadItemKey("碳化");
        badForm2.setBadItemValue(new BigDecimal("2"));
        badForms.add(badForm2);

        MoldingDuty moldingDuty = new MoldingDuty();
        moldingDuty.setQualifiedQtya(new BigDecimal("1"));
        moldingDuty.setJobTime(new BigDecimal("1"));
        moldingDuty.setMoldingDuty(new BigDecimal("1"));


        vo.setTimeProfiles(timeProfiles);
        vo.setActualSituation(actualSituation);
        vo.setBadForms(badForms);
        vo.setMoldingDuty(moldingDuty);
    }
}
